{{define "mobile/ordinary/lifeStyle.html"}}
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
	<meta name="format-detection" content="telephone=no">
	<title>生活方式</title>
	<link rel="stylesheet" type="text/css" href="/res/mobile/css/weui.css"/>
	<link rel="stylesheet" type="text/css" href="/res/mobile/css/example.css"/>
	<link rel="stylesheet" type="text/css" href="/res/mobile/css/bootstrap.min.css" />
	<link rel="stylesheet" type="text/css" href="/res/mobile/css/base.css?v=3" />
	<style type="text/css">
		.GUSmoking {
			margin-top: -5px;
		}
		.NOWSmoking {
			margin-top: -5px;
		}
	</style>
</head>
<body ontouchstart>
	<div  class="header">生活方式</div>
	<div class="container" id="container">
		<div class="page flex js_show">
			<div class="page__bd" style="height: 100%;">
				<div class="weui-tab">
					<div class="weui-tab__panel">
						<div class="page__bd page__bd_spacing">
							<div class="_cut"></div>
							<div class="personal second-title">生活方式</div>
							<div class="weui-flex">
								<div>
									<div class="placeholder">是否吸烟：</div>
								</div>
								<div class="weui-flex__item">
									<div class="placeholder " id="isSmoking"></div>
								</div>
							</div>
							<div class="weui-flex hide" id="xiyanqingkuang">
								<div>
									<div class="placeholder">吸烟情况：</div>
								</div>
								<div class="weui-flex__item">
									<div class=" weui-ws_three  " id="smokingStatus"></div>
									<div class="GUSmoking hide">
										<div class=" weui-ws_three  ">戒烟年限：<span id="smokingYearsForGiveUp"></span></div>
										<div class=" weui-ws_three  ">曾经吸烟年限：<span id="smokingYearsForHistory"></span></div>
									</div>
									<div class="NOWSmoking hide">
										<div class=" weui-ws_three  ">吸烟年限：<span id="smokingYearsForNow"></span></div>
										<div class=" weui-ws_three  ">每天几只：<span id="smokingAmountForNow"></span></div>
									</div>
								</div>
							</div>
							<div class="weui-flex">
								<div>
									<div class="placeholder">饮酒：</div>
								</div>
								<div class="weui-flex__item">
									<div class="placeholder " id="drinking"></div>
								</div>
							</div>
							<div class="weui-flex">
								<div>
									<div class="placeholder">运动习惯：</div>
								</div>
								<div class="weui-flex__item">
									<div class="placeholder " id="sportStatus"></div>
								</div>
							</div>
							<div class="weui-flex">
								<div>
									<div class="placeholder">膳食习惯：</div>
								</div>
								<div class="weui-flex__item">
									<div class=" weui-ws_three  ">口味：<span id="flavor"></span></div>
									<div class=" weui-ws_three  ">荤素：<span id="meatAndVeg"></span></div>
									<div class=" weui-ws_three  ">吃蔬菜(每日食用6两蔬菜)：<span id="vegetables"></span></div>
									<div class=" weui-ws_three  ">吃水果(每日食用4两水果)：<span id="fruit"></span></div>
								</div>
							</div>
						</div>
						<div class="button-sp-area cell">
				          	<a onclick="history.back(-1);return false;" class="weui-btn_cell weui-btn_cell-default">返回</a>
				        </div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<script type="text/javascript" src="/res/mobile/js/zepto.min.js"></script>
	<script type="text/javascript" src="/res/mobile/js/jweixin-1.0.0.js"></script>
	<script type="text/javascript" src="/res/mobile/js/weui.min.js"></script>
	<!-- <script type="text/javascript" src="/res/mobile/js/example.js"></script> -->
	<script type="text/javascript" src="/res/mobile/js/jquery-3.2.1.min.js"></script>
	<script type="text/javascript" class="tabbar js_show">
		$(function(){
			//获取用户信息
			$.post("/mobile/ordinary/getUserData",{},function(r){
				if(r){
					if(r.code!=1){
						window.location.href="/mobile/ordinary/login"
					}else{
						var livingStatus = r.data["livingStatus"]
						if (livingStatus){
							$.each(livingStatus,function(i,v){
								if(i=="isSmoking"&&v=="是"){
									$("#xiyanqingkuang").removeClass("hide");
								}
								if(i=="smokingStatus"){
									if(v=="正在吸"){
										$(".NOWSmoking").removeClass("hide");
									}else{
										$(".GUSmoking").removeClass("hide");
									}
								}
								if(i=="fruit"){
									if(v=="0"){
										v=">=5天/周"
									}else if(v=="1"){
										v="3-4天/周 "
									}else if(v=="2"){
										v="<=2天/周"
									}
								}
								if(i=="vegetables"){
									if(v=="0"){
										v=">=5天/周"
									}else if(v=="1"){
										v="3-4天/周 "
									}else if(v=="2"){
										v="<=2天/周"
									}
								}
								$("#"+i).text(v);
							})
						}
					}
				}else{
					window.location.href="/mobile/ordinary/login"
				}
			})
		});
	</script>
</body>
</html>
{{end}}